﻿using System;

namespace Notepad_X.Classes
{
    public class shortcutkey 
    {
        public System.Windows.Forms.Keys key;
        public string getString;

        /// <summary>
        /// Constructor for creating shortcut keys
        /// </summary>
        public shortcutkey(bool control, bool shift, bool alt, System.Windows.Forms.Keys _key)
        {
            System.Windows.Forms.Keys _control = System.Windows.Forms.Keys.Control;
            System.Windows.Forms.Keys _shift = System.Windows.Forms.Keys.Shift;
            System.Windows.Forms.Keys _alt = System.Windows.Forms.Keys.Alt;
            getString = "";
            if (!control) { _control = System.Windows.Forms.Keys.None; } else { getString += "control|"; };
            if (!shift) { _shift = System.Windows.Forms.Keys.None; } else { getString += "shift|"; };
            if (!alt) { _alt = System.Windows.Forms.Keys.None; } else { getString += "alt|"; };
            getString += _key.ToString();
            key = ((System.Windows.Forms.Keys)((((_control | _alt) | _shift) | _key)));
        }
    }
    public class shortcut
    {
        public System.Windows.Forms.ToolStripMenuItem item;
        public System.Windows.Forms.Keys key;
        public string keyString;

        public shortcut(System.Windows.Forms.ToolStripMenuItem _item,System.Windows.Forms.Keys _key,string _keyString)
        {
            item = _item;
            key = _key;
            keyString = _keyString;
            item.ShortcutKeys = key;
        }
        public void ChangeKey(System.Windows.Forms.Keys _key)
        {
            key = _key;
        }
        public void ClearKey()
        {
            key = System.Windows.Forms.Keys.None;
            keyString = null;
        }
    }
}
